import requests

headers = {
    'accept': 'application/json, text/plain, */*',
    'accept-language': 'en',
    'app-name': 'xiaoyi',
    'authorization': 'Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6Inh5ODZhNWFlIiwidHlwIjoiSldUIn0.eyJhdWQiOlsieGlhb3lpIl0sImV4cCI6MTc0NTE1NDkyMSwiaWF0IjoxNzQ0ODk1NzIxLCJkZXZpY2VfaWQiOiIxZWZkMGM5N2JiNjBjMDg3NGU2MWZiNTczODY1YWQ3ZSIsInVzZXJfdHlwZSI6MywidmVyc2lvbiI6M30.HBuOCFie1baTAmDcceckOMHWFXNJVdBb2dCgzkCErCqJMkM903G0CxdpPlDzQq1ZmfZEt8ifxoSjq14VM1xXkw',
    'content-type': 'application/json',
    'device-id': '1efd0c97bb60c0874e61fb573865ad7e',
    'origin': 'https://fanyi.caiyunapp.com',
    'os-type': 'web',
    'os-version': '4.7.0',
    'priority': 'u=1, i',
    'referer': 'https://fanyi.caiyunapp.com/',
    'sec-ch-ua': '"Microsoft Edge";v="135", "Not-A.Brand";v="8", "Chromium";v="135"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'cross-site',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 Edg/135.0.0.0',
    'x-authorization': 'token:qgemv4jr1y38jyq6vhvi',
}

json_data = {
    'trans_type': 'zh2en',
    'source': '开心',
}

response = requests.post('https://api.interpreter.caiyunai.com/v1/dict', headers=headers, json=json_data)
print(response.json()['dictionary']['entry'])
print(response.json()['dictionary']['explanations'][0])
# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{"trans_type":"zh2en","source":"努力"}'.encode()
#response = requests.post('https://api.interpreter.caiyunai.com/v1/dict', headers=headers, data=data)